package com.huadi.controller;


import com.huadi.domain.ExamPoint;
import com.huadi.domain.Teacher;
import com.huadi.service.ExamPointService;
import com.huadi.service.TeacherService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.annotation.Resource;

@Controller
@RequestMapping("/examPoint")

public class ExamPointController {

    @Resource
    private ExamPointService service;
    @RequestMapping("/addExamPoint")
    public ModelAndView addExamPoint(ExamPoint examPoint){
        ModelAndView mv1 = new ModelAndView();
        String tips = "注册失败";
        int nums1 = service.addExamPoint(examPoint);
        if ( nums1 > 0){
            tips = "考点【"+examPoint.getExam_Point_id()+"】注册成功";
        }

        mv1.addObject("tips",tips);

        mv1.setViewName("success");

        return mv1;
    }
}
